// *** LICENSE HEADER ***
// Filename: ./fonts.h
// This file is part of Nodewarz 0.1
// Nodewarz is a 3d OpenGL strategy game
// Copyright (C) 2007 CZestmyr
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// *** END LICENSE HEADER ***
#ifndef NODEWARS_FONTS_H
#define NODEWARS_FONTS_H

#include <SDL.h>
#include "ft2build.h"
#include FT_FREETYPE_H
#include "engine.h"
#include "logger.h"
#include "helperfunctions.h"

enum fontType{
    FT_MENU,
    FT_GAME
};

class engine;

//This class draws a string of text on the screen using a given font type
class fonts {
    public:
        fonts(engine* newParent);

        //Load the font types
        void LoadFonts();
        //Unload the fonts
        void UnloadFonts();

        //Print the given string at the given coordinates with the specified color
        void Print(fontType type, const char* text, int posX, int posY, int height, SDL_Color color);
    private:
        //[fontType][0=textureHandle, 1=glyphWidth, 2=glyphTopOffset][glyphNumber]
        GLuint fontGlyphs[2][3][256];
        engine* parent;
};

#endif
